<?php
/**
 * +--------------------------------------------------------
 * | 后台首页控制器
 * +--------------------------------------------------------
 * | Author: zouhaochang
 * +--------------------------------------------------------
 * | Date: 2017/12/07
 * +--------------------------------------------------------
 */
namespace app\admin\controller;
use \think\Controller;
use think\Session;

class Index extends Controller
{
    //后台首页
    public function index(){
        if(session('id') or cookie('id')){
            if (!session('id'))  {
                session('id', cookie('id'));
                session('identity', cookie('identity'));
            }
            return view();
        }else{
            return $this->fetch('index/login');
        }
    }
    //登录
    public function login(){
        if(request()->isAjax()){
            $user= model('member');
            return json($user->login());
        }
    }
}
